/*
 * @Author: yankun2000 yankun@powerpms.com
 * @Date: 2024-05-16 10:44:57
 * @LastEditors: yankun2000 yankun@powerpms.com
 * @LastEditTime: 2024-05-16 14:48:18
 * @FilePath: \vue3-element-admin\src\hooks\useTitle.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
export default function useTitle(title: string) {
  const newTitle = ref(title);
  watch(newTitle, (newValue, old) => {
    document.title = newValue;
  }, { immediate: true });
  return title;
}